﻿
using Org.BouncyCastle.Crypto.Digests;
using Org.BouncyCastle.Crypto;
using System.Text;

namespace AhCha.Fortunate.Common.Utility
{
    /// <summary>
    /// SM3与SM2和SM4冲突
    /// </summary>
    public class SM3Context
    {
        //public static string Hash(string value)
        //{
        //    byte[] inputBytes = Encoding.UTF8.GetBytes(value);
        //    IDigest digest = new SM3Digest();
        //    digest.BlockUpdate(inputBytes, 0, inputBytes.Length);
        //    byte[] hash = new byte[digest.GetDigestSize()];
        //    digest.DoFinal(hash, 0);
        //    StringBuilder hex = new StringBuilder(hash.Length * 2);
        //    foreach (byte b in hash)
        //    {
        //        hex.AppendFormat("{0:x2}", b);
        //    }
        //    return hex.ToString().ToUpper();
        //}





    }
}
